@extends('admin.layout.layout', ['row' => @$page])

@section('contain')


    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions"></div>
        </div>

        <form action="/{{ request()->path() }}/../" method="post" class="form">
            @csrf
            <div class="row">
                <div class="col-3 text-right pt-1">
                    <strong>{{ ts('jsmc') }}：</strong>
                </div>
                <div class="col-6">
                    <input type="text" value="{{ @$data->name }}" name="name" class="form-control">
                </div>
            </div>
            <div class="row my-3">
                <div class="col-3 text-right pt-1">
                    <strong>{{ ts('qxgl') }}：</strong>
                </div>
                <div class="col-6">
                    <table class="table table-s2 text-center">
                        <thead>
                        <tr>
                            <th>
                                {{ ts('DHMC') }}
                            </th>
                            <th>
                                {{ ts('qxgl') }}
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        @foreach(@$permission as $v)
                            <tr>
                                <td>
                                    <label>
                                        {{--<input type="checkbox" value="{{ $v['value'] }}" name="permissions[]" {{ @$v['checked'] ? 'checked' : '' }} class="mr-1">--}}
                                        {{ @$v['label'] }}
                                    </label>
                                </td>
                                <td class="ttt">
                                    <table class="table">
                                        <tbody>
                                        @empty($v['children'])
                                        @else
                                            @foreach(@$v['children'] as $c)
                                                <tr>
                                                    <td>
                                                        <label>
                                                            <input type="checkbox" value="{{ $c['value'] }}" name="permissions[]" {{ @$c['checked'] ? 'checked' : '' }} class="mr-1">
                                                            {{ @$c['label'] }}
                                                        </label>
                                                    </td>
                                                </tr>
                                            @endforeach
                                        @endif
                                        </tbody>
                                    </table>
                                </td>
                            </tr>

                        @endforeach
                        </tbody>
                    </table>
                </div>
            </div>

            <div class="row">
                <div class="col-3"></div>
                <div class="col">
                    <button class="btn btn-primary">{{ ts('submit') }}</button>
                </div>
            </div>

        </form>

    </div>


@endsection


@section('script')
    <script>

    </script>
@endsection